package com.chuang.bootplus.controller;


import com.chuang.bootplus.base.constant.Constant;
import com.chuang.bootplus.base.utils.ApiResponse;
import com.chuang.bootplus.po.SignPO;
import com.chuang.bootplus.service.SignInService;
import com.chuang.bootplus.service.TipsService;
import com.chuang.bootplus.vo.SignVO;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RestController;

import java.time.LocalDate;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author ${author}
 * @since 2021-08-17
 */
@Api(tags = "签到")
@RestController
@RequestMapping("/sign_In")
@RequiredArgsConstructor(onConstructor = @__(@Autowired))
public class SignInController {

    final TipsService tipsService;
    final SignInService signInService;

    @ApiOperation("签到成功")
    @PostMapping("sign")
    public ApiResponse<Void> sign(@RequestBody SignPO po){
        return signInService.sign(po);
    }

    @ApiOperation("签到时间列表")
    @PostMapping("signDateList")
    public ApiResponse<SignVO> signDateList(@RequestBody SignPO po){
        return signInService.signDateList(po);
    }

}

